#include "lexer/lexercc.hpp"
#include <iostream>

using namespace std;

int main(){
    MyLexer lexer;
    lexer.addRegex("email", "([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+"
                   "[a-zA-Z]+", 1);
    string line;
    cin >> noskipws;
    while (true) {
        cout << "Input: ";
        getline(cin, line);
        vector<Token> tokens;
        try {
            tokens = lexer.lex(line);
        } catch (ParseException e) {
            continue;
        }
        for (auto i : tokens) {
            cout << i.tokenName << ": " << i.word << endl;
        }
    }
}